package com.car.server.impl;

import com.car.dao.impl.AdminLogImpl;
import com.car.domain.Admin;
import com.car.server.AdminLogServer;

import java.util.UUID;

/**
 * 核验用户名，密码，判断是否存在
 * 传回web
 */
public class AdminLogServerImpl implements AdminLogServer {
    @Override
    public Admin logCheck(Admin admin) {
        return new AdminLogImpl().logCheck(admin);
    }


    @Override
    public int RegisterAdd(Admin admin) {
        //生成随机字符串
        String replace = UUID.randomUUID().toString().replace("-", "");
        Admin admin1 = new AdminLogImpl().registerCheck(admin, replace);
        if (admin1==null){
            return 0;
        }
        return  new AdminLogImpl().RegisterAdd(admin,replace);
    }
}
